﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports DataObject
Imports DataObject.hDBase

Public Class BusNhomViTri

    Private NhomViTriDAO As New SqlServerNhomViTri
    Private oTable As New DataTable

    Public Function GetAllNhomViTri(ByVal sStringConnection As String) As Object
        Try
            oTable = NhomViTriDAO.GetAllNhomViTri(sStringConnection)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Return oTable
    End Function

    Public Sub InsertNhomViTri(ByVal sStringConnection As String, ByVal oNhomViTri As NhomViTri)
        Try
            NhomViTriDAO.InsertNhomViTri(sStringConnection, oNhomViTri)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub UpdateNhomViTri(ByVal sStringConnection As String, ByVal oNhomViTri As NhomViTri)
        Dim bool_ As Boolean = True
        Try
            NhomViTriDAO.UpdateNhomViTri(sStringConnection, oNhomViTri)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub DeleteNhomViTri(ByVal sStringConnection As String, ByVal oNhomViTri As NhomViTri)
        Try
            NhomViTriDAO.DeleteNhomViTri(sStringConnection, oNhomViTri.SoNhomViTri)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

End Class
